package cn.exrick.xboot.modules.source.entity;

import cn.exrick.xboot.base.XbootBaseEntity;
import cn.exrick.xboot.common.constant.CommonConstant;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.Entity;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * @author zjl
 * @description TODO
 * @time: 2022/4/15 10:46
 */
@Data
@Accessors(chain = true)
@Entity
@DynamicInsert
@DynamicUpdate
@Table(name = "t_group")
@TableName("t_group")
@ApiModel(value = "小组表")
public class Group extends XbootBaseEntity {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "小组id")
    @NotNull(message = "不能为空")
    private Integer gid;

    @ApiModelProperty(value = "项目名称")
    @NotNull(message = "不能为空")
    private String pName;

    @ApiModelProperty(value = "姓名")
    @NotNull(message = "不能为空")
    private String name;

    @ApiModelProperty(value = "角色")
    private String role;

    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @ApiModelProperty(value = "填表时间")
    private Date time;

    @ApiModelProperty(value = "状态 默认0启用 -1禁用")
    private Integer status = CommonConstant.USER_STATUS_NORMAL;
}

